/*
 * @Author: your name
 * @Date: 2021-12-23 11:58:30
 * @LastEditTime: 2021-12-27 11:03:59
 * @LastEditors: Please set LastEditors
 * @Description:
 * @FilePath: /vite2-vue3-typescript/src/router/index.ts
 */
import { createRouter, RouteRecordRaw, createWebHashHistory } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/Home/index.vue'),
  },
  {
    path: '/flowChart',
    name: 'FlowChart',
    component: () => import('@/views/FlowChart/index.vue'),
  },
  {
    path: '/jsx',
    component: () => import('../views/Jsx/index.vue'),
    name: 'Jsx',
    meta: {
      title: 'Jsx',
      icon: '',
      noCache: true,
      hidden: false,
      permissions: [],
    },
  },
  {
    path: '/tsx',
    component: () => import('../views/Tsx'),
    name: 'Tsx',
    meta: {
      title: 'Tsx',
      icon: '',
      noCache: true,
      hidden: false,
      permissions: [],
    },
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login/index.vue'),
  },
  {
    path: '/404',
    name: '404',
    meta: {
      title: '404',
      icon: '',
      noCache: true,
      hidden: true,
      permissions: [],
    },
    component: () => import('../views/Error/404.vue'),
  },
  { path: '/:pathMatch(.*)*', redirect: '/404' },
  { path: '', redirect: '/home' },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

export default router
